package com.imooc.bilibili.service.impl;

import com.imooc.bilibili.dao.RoleInfoDao;
import com.imooc.bilibili.entity.RoleElementRelation;
import com.imooc.bilibili.entity.RoleInfo;
import com.imooc.bilibili.entity.RoleMenuRelation;
import com.imooc.bilibili.service.AuthRoleMenuRelationService;
import com.imooc.bilibili.service.AuthRoleService;
import com.imooc.bilibili.service.RoleElementRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("authRoleService")
public class AuthRoleServiceImpl implements AuthRoleService {

    @Autowired
    private RoleElementRelationService authRoleElementService;

    @Autowired
    private AuthRoleMenuRelationService authRoleMenuService;

    @Autowired
    private RoleInfoDao roleInfoDao;

    @Override
    public List<RoleElementRelation> getRoleElementByRoleIds(List<Long> roleIdList) {
        return authRoleElementService.getRoleElementByRoleIds(roleIdList);
    }

    @Override
    public List<RoleMenuRelation> getRoleMenuByRoleIds(List<Long> roleIdList) {
        return authRoleMenuService.getRoleMenuByRoleIds(roleIdList);
    }

    @Override
    public RoleInfo queryRoleByRoleCode(String roleCode) {
        return roleInfoDao.queryRoleByRoleCodeDao(roleCode);
    }
}
